#include "apue.h"
#include "error.c"


int main(int argc, char *argv[])
{
    if(argc != 2)
        err_quit("exec param error");

    struct stat statbuf;
    if(stat(argv[1], &statbuf) < 0){
        err_sys("file: %s info error", argv[1]);
    }

    if( chmod(argv[1], (statbuf.st_mode & ~S_IXGRP) | S_ISGID) < 0 ){
        err_sys("chmod file %s error", argv[1]);
    }

    return 0;
}
